<?php
namespace app\back\controller;
use think\Controller;
use think\Request;
use think\Db;
/*关注劵管理*/
class Coupon extends Common
{
    public function index()
    {	
        $coupon=Db::name('coupon')->select();
        $this->assign("coupon",$coupon); 
        return $this->fetch('Coupon/index');
    }
    //删除会员
    public function del_coupon()
    {
        $id = input('id');
        $result = Db::name('coupon')->where('id',$id)->delete();    
        if($result){
            return json(['state' => '1', 'msg' => '删除成功!']);
        }else{
            return json(['state' => '0', 'msg' => '删除失败再试试!']);
        }
    }
 }   